package swu.edu.cn.javaee.controller;

import jakarta.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import swu.edu.cn.javaee.entity.SearchInfo;
import swu.edu.cn.javaee.service.SearchService;

@Controller
public class SearchController {

    @Resource
    private SearchService searchService;

    @RequestMapping("/search")
    @ResponseBody
    public SearchInfo search(String Input){
        SearchInfo searchInfo=searchService.searchByInput(Input);
        return searchInfo;
    }
}
